<template>
  <div id="app">
    <squid-nav v-if="status"></squid-nav>
  </div>
</template>

<script>
import init from "@/json/init.json";
import {mapState} from "vuex";
import SquidNav from "./views/nav/index.vue";

export default {
  name: "App",
  components: {
    SquidNav,
  },
  computed: {
    ...mapState(["status"]),
  },
  created() {
    this.setBackground();
  },
  methods: {
    setBackground() {
      // 设置背景图
      const month = new Date().getMonth();
      let isSingle = month % init.backgroundImages.length;
      let imgPath = init.backgroundImages[isSingle];
      document.body.style.backgroundImage =
          "url(" + require(`./assets/images/${imgPath}`) + ")";
    },
  },
};
</script>


<style lang="less">
@import url("./assets/style/base.less");
@import url("./assets/style/reset.less");

#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
}
</style>
